#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read() {
    int f=0,t=0;
    char c=getchar();
    while(!isdigit(c)) t|=(c=='-'),c=getchar();
    while(isdigit(c)) f=(f<<3)+(f<<1)+c-48,c=getchar();
    return t?-f:f;
}
void write(int x) {
    if(x<0) putchar('-'),x=-x;
    if(x>9) write(x/10);
    putchar('0'+x%10);
}
int f[50005],siz[50005];
int find(int x){if(f[x]==x) return x;return find(f[x]);}
int u[200005],v[200005];
int ans[50005];
int top;
int latx[200005],laty[200005];
void add(int x,int y){
	x=find(x),y=find(y);
	if(x==y) return;
	if(siz[x]>siz[y]){
		siz[x]+=siz[y];f[y]=x;
		latx[++top]=x,laty[top]=y;
	}
	else{
		siz[y]+=siz[x];f[x]=y;
		latx[++top]=y,laty[top]=x;
	}
}
void shan(int now){
	while(top!=now){
		f[laty[top]]=laty[top];
		siz[latx[top]]-=siz[laty[top]];
		top--;
	}
}
signed main(){
	freopen("cut.in","r",stdin);
	freopen("cut.out","w",stdout);
	int n=read(),m=read();
	for(int i=1;i<n;i++) ans[i]=1e18; 
	for(int i=1;i<=m;i++){u[i]=read(),v[i]=read();} 
	for(int i=1;i<n;i++){
		for(int j=i+1;j<n;j++){
			top=0;
			for(int k=1;k<=n;k++) f[k]=k,siz[k]=1;
			for(int k=1;k<n;k++){
				if(k==i||k==j) continue;
				add(u[k],v[k]);
			}
			int sum=2;
			for(int k=n;k<=m;k++){
				int now=top;
				add(u[k],v[k]);
				if(find(u[i])==find(v[i])||find(u[j])==find(v[j])){shan(now),sum++;}
			}
			ans[i]=min(ans[i],sum),ans[j]=min(ans[j],sum);
		}
	}
	for(int i=1;i<n;i++) write(ans[i]),putchar(' ');
	return 0;
}
